package com.zhkjnet.zhyy.job;

import com.zhkjnet.zhyy.service.OilCardService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class OilCardJob {

    private final static Logger logger = LoggerFactory.getLogger(OilCardJob.class);

    @Autowired
    private OilCardService oilCardService;

    /**
     * 重置使用次数
     * 每晚0点执行
     */
    @Scheduled(cron = "0 0 0 * * ?")
    public void setZero() {
        logger.info("execute set zero job");
        oilCardService.setZero();
    }
}
